home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_10
/
1010042a
< prev
next >
Wrap
Text File
|
1992-08-08
|
339b
|
22 lines
int StackPtr;
StackElemTyp Stack [ StackMax ];
void Init ( )
{ StackPtr = -1; }
void Push ( Elem )
StackElemTyp Elem;
{ /* Check overflow here. */
Stack [ ++ StackPtr ] = Elem;
}
StackElemTyp Pop ( )
{ assert ( StackPtr >= 0 )
return Stack [ StackPtr -- ];
}
void CheckEmpty ( )
{ assert ( StackPtr = -1 ) }